package com.itheima.controller;

//状态码
public class Code {
    /*
    * TODO 状态码的设计思路: 设计灵感来自http协议的状态
    *   1. 语法:
    *       响应状态码 + 操作类型 + 成败
    *   2. 常见的状态码
    *       200 : 表示请求成功
    *       500 : 服务器异常
    *       ...
    *   3. 操作类型
    *       1-4 : 增删改查
    *   4. 成败结果
    *       1表示成功
    *       0表示失败
    * */
    public static final Integer SAVE_OK = 20011;
    public static final Integer DELETE_OK = 20021;
    public static final Integer UPDATE_OK = 20031;
    public static final Integer GET_OK = 20041;

    public static final Integer SAVE_ERR = 20010;
    public static final Integer DELETE_ERR = 20020;
    public static final Integer UPDATE_ERR = 20030;
    public static final Integer GET_ERR = 20040;

    public static final Integer SYSTEM_ERR = 50001;
    public static final Integer SYSTEM_TIMEOUT_ERR = 50002;
    public static final Integer SYSTEM_UNKNOW_ERR = 59999;

    public static final Integer BUSINESS_ERR = 60002;
}
